package com.hcbd.tdwt.ui.xingyu.vo;

import com.hcbd.tdwt.util.AppDatabase;
import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;
import com.raizlabs.android.dbflow.sql.language.SQLite;
import com.raizlabs.android.dbflow.structure.BaseModel;

@Table(database = AppDatabase.class)
public class MenuIconVO extends BaseModel {
    @PrimaryKey(autoincrement = true)
    public int id;
    @Column
    public int index;
    @Column
    public String menuName;
    @Column
    public int isShow;//是否显示0不显示 1显示
    @Column
    public String iconType;//图标类型


    public static void upData(MenuIconVO menuIconVO){
        MenuIconVO menuIconVO1= SQLite.select().from(MenuIconVO.class).where(MenuIconVO_Table.id.eq(menuIconVO.id)).querySingle();
        if(menuIconVO1==null){
            menuIconVO1.insert();
        }else{
            menuIconVO.update();
        }

    }
}
